


function storage_name(people) {
    localStorage.setItem("name", people);
    location.href = '../welcome/order.haml';

}


function display_name(){
    $("input#display_people").val(localStorage.getItem("name"));
    $("input#display_restaurant").val(localStorage.getItem("restaurant_name"));
    $("input#display_package").val(localStorage.getItem("package_name"));

}


function storage_restaurant(restaurant){

    localStorage.setItem("restaurant_name",restaurant);
    location.href='../welcome/order.haml';


}
function jump_package() {
   if(localStorage.getItem("restaurant_name")!=undefined){
    var restaurant = localStorage.getItem("restaurant_name");
    location.href = '../welcome/fist_package/'+ restaurant}
   else{
        $('button#ban_choose').attr('disabled',"true");

    }


}

function storage_package(package,price){
    localStorage.setItem("package_name",package);
    localStorage.setItem("package_price",price)
    location.href='../../welcome/order.haml'
}



function save_clean(){
 if(localStorage.getItem("name")!=undefined&&localStorage.getItem("restaurant_name")!=undefined&&localStorage.getItem("package_name")!=undefined) {
     var url = "/welcome/create";
     var date = form_object();
     var success = function () {
         alert("成功");
     };
     var error = function () {
         alert("失败");
     };
     post_ajax(url, date,  error,success);

     localStorage.removeItem("name");
     localStorage.removeItem("restaurant_name");
     localStorage.removeItem("package_name");
     location.href = "../welcome/order"
 }


   else{
        $('button#determine').attr('disabled',"true");
    }
}
function form_object(){
    var object_date={}
    object_date.people = localStorage.getItem("name");
    object_date.restaurant = localStorage.getItem("restaurant_name");
    object_date.package = localStorage.getItem("package_name");
    object_date.price =localStorage.getItem("package_price")
    return object_date

}

//function hh(){
//    var url = "welcome/order";
//    var date = function form_object(){};
//    var success = function(){
//        alert("成功");
//    };
//    var error = function(){
//        alert("成功");
//    };
//
//}

